<template>
  <div>
    <div class="top">
      <div class="top-title">考场列表</div>
      <!-- <div>
        <div v-for="(item, index) in jibies" :key="index" class="top-jibie shou" :class="index_jibie === index?'top-select':''" @click="index_jibie=index">{{item.name}}</div>
      </div> -->
    </div>
    <div class="body">
      <div class="card shou" v-for="(item, index) in table" :key="index" @click="toPeople(item)">
        <el-tooltip class="item" effect="dark" :content="item.name" placement="top">
          <div class="card-title shenglue" >{{item.name}}</div>
        </el-tooltip>
        <el-tooltip class="item" effect="dark" :content="item.computerPlace" placement="top">
          <div class="card-text shenglu">上机地点：{{item.computerPlace||'-'}}</div>
        </el-tooltip>
        <el-tooltip class="item" effect="dark" :content="item.place" placement="top">
          <div class="card-text shenglue">实操地点：{{item.place||'-'}}</div>
        </el-tooltip>
      </div>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import $http from '@/utils/request'

export default {
  name: 'Dashboard',
  computed: {
    ...mapGetters([
      'name'
    ])
  },
  data () {
    return {
      span1: 3,
      span2: 9,
      dialogAdd: false,
      index_jibie: 0,
      value: '',
      values: [],
      table: [],
      jibies: [{
        name: '级别一',
        value: 1,
      }, {
        name: '级别二',
        value: 2,
      }],
      zhuanyes: [{
        panduan: false
      },{
        panduan: false
      }],
      form: {
        id:'',
      }
    }
  },
  mounted () {
    this.form = JSON.parse(localStorage.getItem('info'))
    $http.get('/examiner/query/examlist/' + this.form.id).then(response => {
        if (response.success) {
          this.table = response.data
        } else  {
          this.$message({
            message: response.msg,
            type: 'error',
            duration: 2000
          })
        }
        
      }).catch(error => {
        console.log(error)
      })
  },
  methods: {
    toPeople(item) {
      this.$router.push({
          path:"/people",//目标路径
          query:{
              id: item.id,//要传的值
          }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.top-jibie{
  float: left;
  width: 60px;
  height: 46px;
  margin-right: 30px;
  color: rgba(153, 153, 153, 100);
  font-size: 14px;
  text-align: center;
  font-family: PingFangSC-Regular;
  display: flex;
  justify-content: center;
  align-items: center;
}
.top-select {
  color: #1890FF;
  border-bottom: 2px solid #1890FF;
}
.top-title{
  // margin-top: -20px;
  float: left;
  width: 100px;
  height: 40px;
  font-size: 16px;
  color: rgba(51, 51, 51, 100);
  font-size: 20px;
  display: flex;
  // justify-content: center;
  // align-items: center;
}
.body{
  display: flex;
  justify-content: space-around;
  // align-items: center;
  flex-wrap: wrap;

  width:100%;
  padding: 24px;
  
}
.card{
  width: 277px;
  height: 106px;
  margin: 0px 5px 24px 5px;
  border-radius: 2px;
  background-color: rgba(255, 255, 255, 1);
  box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.09);
  padding: 18px 20px 18px 20px;
}
.card-title{
  font-size: 16px;
  font-weight: bold;
  color: rgba(51, 51, 51, 100);
}
.card-text{
  margin-top: 5px;
  font-size: 14px;
  color: rgba(102, 102, 102, 100);
}
</style>
